package com.avery.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ContextUtil {
    private static ApplicationContext context;

    public static ApplicationContext getContext() {
        if(context==null){
            context = new ClassPathXmlApplicationContext("applicationContext.xml");
        }
        return context;
    }

    public void setContext(ApplicationContext context) {
        ContextUtil.context = context;
    }
}